# This code is part of the MWP System
# Copyright (c) 2012 Benjamin Lubin (blubin@bu.com) 
# Published under and subject to the GPLv2 license available at http://www.gnu.org/licenses/gpl-2.0.html

'''
Created on Dec 18, 2012
@author: blubin
'''

from frontend.roleApplication import RoleApplication;
from frontend.form import Type;
from unique import UNIQUE;

class PainterApplication(RoleApplication):
    """ The Physician User Interface """

    def __init__(self):
        super(PainterApplication, self).__init__("Gallery"+UNIQUE, "Painter");
        self.register_source_step("SubmitPainting", self.submit_form_creator, name_fields=["sequence", "PainterName","PaintingName"]);
        self.register_transition_step("CheckStatus", self.status_form_creator, name_fields=["sequence", "PainterName", "PaintingName", "IsAccepted"]);
        #self.register_transition_step("WritePrescription", self.write_prescription_form_creator, name_fields=["sequence", "FirstName", "LastName", "Birthday", 'PrescriptionNumber']);

    def submit_form_creator(self, stepname, form):
        form.add_task_label(fields=["sequence", "PainterName","PaintingName"]);
        form.add_field(Type.SHORTSTRING, "Name");
        form.add_field(Type.SHORTSTRING, "Painting");
        #form.add_field(Type.LONGSTRING, "Description");

    def status_form_creator(self, stepname, form):
        form.add_task_label(fields=["sequence", "PainterName","PaintingName"]);
        form.add_field(Type.BOOLEAN, "IsAccepted");
    
    #def write_prescription_form_creator(self, stepname, form):
#        form.add_task_label(fields=["FirstName", "LastName", "Birthday"]);
#        form.add_field(Type.SHORTSTRING, "DrugName");
 #       form.add_field(Type.SHORTSTRING, "Dose");
  #      form.add_field(Type.SHORTSTRING, "Frequency");
   #     form.add_field(Type.INTEGER, "Refills");
    #    form.add_field(Type.BOOLEAN, "IsGenericAcceptable");

if __name__ == '__main__':
    app = PainterApplication();
    app.MainLoop();